package com.zkthink.ceres.product.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.zkthink.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import java.time.LocalDateTime;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import static com.zkthink.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 专题商品表
 * </p>
 *
 * @author JustArgo
 * @since 2020-09-11
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ceres_subject_product")
@ApiModel(value = "SubjectProduct", description = "专题商品表")
@AllArgsConstructor
public class SubjectProduct extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 专题id
     */
    @ApiModelProperty(value = "专题id")
    @NotNull(message = "专题id不能为空")
    @TableField("subject_id")
    @Excel(name = "专题id")
    private Long subjectId;

    /**
     * 专题对应的商品id
     */
    @ApiModelProperty(value = "专题对应的商品id")
    @NotNull(message = "专题对应的商品id不能为空")
    @TableField("product_id")
    @Excel(name = "专题对应的商品id")
    private Long productId;

    /**
     * 是否展示
     */
    @ApiModelProperty(value = "是否展示")
    @NotNull(message = "是否展示不能为空")
    @TableField("display")
    @Excel(name = "是否展示")
    private Integer display;

    /**
     * 是否删除 1-删除 0-不删除
     */
    @ApiModelProperty(value = "是否删除 1-删除 0-不删除")
    @NotNull(message = "是否删除 1-删除 0-不删除不能为空")
    @TableField("is_delete")
    @Excel(name = "是否删除 1-删除 0-不删除", replace = {"是_true", "否_false", "_null"})
    private Boolean isDelete;

    @Builder
    public SubjectProduct(Long id, LocalDateTime createTime, Long createUser, LocalDateTime updateTime, Long updateUser,
                          Long subjectId, Long productId, Integer display, Boolean isDelete) {
        this.id = id;
        this.createTime = createTime;
        this.createUser = createUser;
        this.updateTime = updateTime;
        this.updateUser = updateUser;
        this.subjectId = subjectId;
        this.productId = productId;
        this.display = display;
        this.isDelete = isDelete;
    }
}
